import React from 'react';
import { Redirect } from 'umi';
export default (props: any) => {
  const isLogin = localStorage.getItem('token');
  return <div>{props.children}</div>;
  if (isLogin) {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to={`/login?from=${props.location.pathname}`} />;
  }
};
